<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
  window.onload=function(){


      //方式一
    //   var body=document.body;
    //   var child=body.childNodes;
    // //   console.log(body.childNodes)
 

    // var arr= Array.from(child);
    // console.log(arr)







    //方式二 slice


    var body=document.body;
    var child=body.childNodes;

//     var arr=[];
//     console.log(arr.slice.call(child))

console.log(Array.prototype.slice.call(child))
 }      

 
    
    </script>
</head>
<body>
    <div>
        <span></span>
    </div>
    <div></div>
    <div></div>
</body>
</html>